//
//  THPhotosNameView.m
//  THImageEditDemo
//
//  Created by 谭簧 on 2018/5/5.
//  Copyright © 2018年 Tan.huang. All rights reserved.
//

#import "THPhotosNameView.h"
#import "THAssetCell.h"

@interface THPhotosNameView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, weak) UITableView *tableView;
@end

@implementation THPhotosNameView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configView];
    }
    return self;
}

- (void)configView {
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    tableView.rowHeight = 70;
    tableView.tableFooterView = [[UIView alloc] init];
    tableView.dataSource = self;
    tableView.delegate = self;
    [tableView registerClass:[THAlbumCell class] forCellReuseIdentifier:@"THAlbumCell"];
    [self addSubview:tableView];
}


#pragma mark - UITableViewDataSource && Delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _albumArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    THAlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"THAlbumCell"];
    cell.model = _albumArr[indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  
}

@end
